package com.dwj.auto.comment.common.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;

/**
 * @author: dangweijian
 * @description: 认证管理器
 * @create: 2020-07-10 15:58
 **/
@Component
public class UserAuthenticationManager implements AuthenticationManager {

    @Autowired
    private UserAuthenticationProvider userAuthenticationProvider;

    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        return userAuthenticationProvider.authenticate(authentication);
    }
}